<template>
<CountText :count="count"></CountText>
<CountBtn :count="count"  @changeCount="changeCount" @updatedCount="updatedCount">
    
</CountBtn>
</template>

<script setup>
import { ref } from 'vue';
import CountText from './CountText.vue';
import CountBtn from './CountBtn.vue';
const count = ref(0);

function countIncrease(){
    count.value++;
}
function countReduce(){
    count.value--;
}
function changeCount(data){
    count.value = data;
}
function updatedCount(item) {
    item?count.value++:count.value--;
}
</script>

<style scoped>

</style>